package anno;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class TestAnnotation {

    public static void main(String[] args) {
        //初始化spring环境
        ApplicationContext context=new ClassPathXmlApplicationContext("beans_anno.xml");

        //上面代码执行，那么所有bean都被容器实例化了，下面我们问容器拿

       UserService userService=(UserService)context.getBean("userService");

        System.out.println(userService.isExists(13));
    }
}
